package lab02.Test05;

/**
 * Created by lenovo on 2017/10/15.
 */
public class cube {
    public static void main(String[] args) {
      Box b1=new Box();
        b1.setDemo(3,4,5);
        System.out.println("体积="+b1.GetV());
        Box b2=new Box(3,4,5);
        System.out.println("体积="+b2.GetV());



    }
}
class Box{
    private double length;
    private double  width;
    private double height;
    public void setDemo(double l,double w,double h){
        this.length=l;
        this.width=w;
        this.height=h;

    }
    public Box(){



    }
    public Box(double l,double w,double h){
        this.length=l;
        this.width=w;
        this.height=h;
    }
    public double GetV(){
        return height*length*width;
    }
}



